component
{
    public any function init(Any arguments)
    {
        structAppend(variables, arguments, true);
        return this;
    }

    public Struct function getMemento()
    {
        var local = structNew();

        if(not structKeyExists(variables,'_metaData')){
            variables['_metaData'] = getMetaData(this);
        }
        local.md = variables['_metaData'];

        local.memento = structNew();

        for(local.i=1;local.i<=arrayLen(local.md.properties);local.i++){
            local.prop = local.md.properties[local.i];

            if(structKeyExists(variables,local.prop.name)){
                local.propVal = variables[local.prop.name];

                if(isSimpleValue(local.propVal) and len(local.propVal)){
                    local.memento[local.prop.name] = local.propVal;
                }
            }
        }
        return local.memento;
    }

    public void function setMemento(struct memento)
    {
        var local = structNew();

        if(not structKeyExists(variables,'_metaData')){
            variables['_metaData'] = getMetaData(this);
        }
        local.md = variables['_metaData'];

        for(local.i=1;local.i<=arrayLen(local.md.properties);local.i++){
            local.prop = local.md.properties[local.i];

            if(structKeyExists(arguments.memento,local.prop.name)){
                local.propVal = arguments.memento[local.prop.name];

                if(isSimpleValue(local.propVal) and len(local.propVal)){
                    variables[local.prop.name] = local.propVal;
                }
            }
        }
    }
}
